home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11250 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: aadt.sdt.com!usenet
  2. From: Larry Baker <leb@sdt.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Will JAVA kill C++?
  5. Date: Wed, 13 Mar 1996 10:56:33 -0800
  6. Organization: SABRE Decision Technologies
  7. Message-ID: <31471A61.3510@sdt.com>
  8. References: <313E44EA.14D110C0@netcom.com> <4hp18v$3di@frodo.smartlink.net> <4ht8k1$t7l@epx.cis.umn.edu> <3146278D.7703E9CC@netcom.com>
  9. NNTP-Posting-Host: parmail
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win16; I)
  14.  
  15. Adam Megacz wrote:
  16. > I'm not a Fortran buff, but I don't understand why C is faster
  17. > than C++. C++ supports all C features (except the void* crap).
  18. > If anything, C++'s type-checking allows more compiler
  19. > optimizations, making it a slightly faster language.
  20.  
  21. If you code _exactly_ the same way using a C++ compiler, in
  22. essence using the C++ compiler to compile a "C" program, then
  23. you should see no performance difference on non-optimized code.
  24.  
  25. C vs Fortran raises a few other interesting comparisons. All variables
  26. in FORTRAN are the equivalant of C "static" types - they aren't
  27. dynamically pushed/popped off of the stack, as with automatic C
  28. variables, or dynamically allocated using malloc/free, as they
  29. may be (even as automatic, stack-based instances) in C++.  Hence
  30. the C runtime semantics, and moreso the C++ runtime semantics, may
  31. incur some slight "background" overhead when compared to a much
  32. simpler language like FORTRAN.
  33.  
  34. Larry Baker
  35. leb@sdt.com
  36.